home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Code Resources / Jims CDEFs 1.50 / demo Source ƒ / demoBoxes.c < prev    next >
Encoding:
Text File  |  1995-10-27  |  1.1 KB  |  50 lines  |  [TEXT/KAHL]

  1. // -----------------------------------------------------------------------------
  2. //    File    : demoBoxes.c
  3. //    Date    : June 18, 1995
  4. //    Author    : Jim Stout
  5. //    Purpose    : show the various types of Group boxes available with CDEF 1101
  6. //            :
  7. // -----------------------------------------------------------------------------
  8.  
  9. #include "demoDialog.h"
  10. #include "movableModal.h"
  11.  
  12. extern void demoBoxes()
  13. {
  14.     DialogPtr            theDialog;
  15.     short                itemHit,t,i;
  16.     Rect                r;
  17.     ControlHandle        h=0,ch=0;
  18.     Boolean                on=true;
  19.     
  20.     theDialog = GetNewDialog(240,0L,(DialogPtr)-1);
  21.     if(theDialog) {
  22.         SetPort(theDialog);    
  23.         
  24.         ShowWindow(theDialog);
  25.         
  26.         do {
  27.             movableModalDialog(nil,&itemHit);
  28.             switch(itemHit) {
  29.                 case 2:
  30.                     for(i=3;i<11;i++ ) {
  31.                         GetDItem(theDialog, i, &t, (Handle *)&h, &r);
  32.                         if(on)
  33.                             HiliteControl(h, 0xFF);
  34.                         else
  35.                             HiliteControl(h, 0);
  36.                     }
  37.                     on = !on;
  38.                     GetDItem(theDialog, 2, &t, (Handle *)&h, &r);
  39.                     if(on)
  40.                         SetControlTitle(h, "\pDisable");
  41.                     else {
  42.                         SetControlTitle(h, "\pEnable");
  43.                     }
  44.                 break;
  45.             }
  46.         }while(itemHit != 1);
  47.         DisposDialog(theDialog);
  48.     }
  49. }
  50.